import 'dart:async';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sainbainu/common/repositories/common_repository.dart';
import 'package:sainbainu/common/repositories/login_repository.dart';
import 'package:sainbainu/common/values/constant.dart';

enum PageType {
  /// 手机号一键登录
  eazyLogin,

  /// 验证码登录
  codeLogin,

  /// 密码登录
  pwdLogin,

  /// 找回密码
  findPwd,

  /// 重置密码
  resetPwd,
}

class LoginState {
  /// 当前登陆类型
  final curPageType = PageType.eazyLogin.obs;

  /// 是否同意协议
  final agreeChecked = false.obs;

  late CommonRepository commonRepository;
  late LoginRepository loginRepository;

  late TextEditingController mobileController;
  late TextEditingController codeController;
  late TextEditingController pwdController;

  Timer? smsTimer;
  final smsSeconds = AppConstant.smsSeconds.obs;
  final isSending = false.obs;

  var showWechat = true.obs;
}
